<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="java.io.*, java.sql.*, java.util.*,LS.*, date.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%request.setCharacterEncoding("utf-8"); %>
<!DOCTYPE html>
<html lang="UTF-8">
<style>
body,table,tr,td,select,input,div,form,textarea,font{font-family:Mond; font-size=12pt; } 
table {
	width: 90%;
	margin-left: 20px;
}

.title {
	width: 21%;
	margin: 0px;
}

td,tr {
	font-weight: bolder;
	padding: 10px;
}

#outerview {
	padding-top: 10px;
	margin-left: 0px;
	text-align: center;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

#outerview {
	width: 100%;
	min-height: 550px;
	padding: 0px;
}

#middleview {
	width: 90%;
	height: 420px;
	margin: 0px auto 0px auto;
	left: 50%;
}

#innerview {
	margin-top: 30px;
	width: 100%;
	height: 100%;
	text-align: center;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.btntd {
	text-align: center;
}

.rightdiv {
	text-align: right;
}

#addsuccess {
	border: 1px solid #000000;
}
</style>

<head>
<meta charset="utf-8">
<title>성공회대학교 기자재 대여 시스템</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- styles시트 -->
<link href="/LSsystem/assets/css/bootstrap.css" rel="stylesheet">
<link href="/LSsystem/assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/LSsystem/assets/css/docs.css" rel="stylesheet">

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>    
<script type="text/javascript" src="/LSsystem/assets/js/bootstrap.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$('.dropdown-toggle').dropdown();
	});
	
	function del(){
		var item_id = document.getElementById("select_item_del").value;
		document.location = 'addItemLoading.do?mode=delete&item_id='+item_id;
	}
	
	function modify(){
		var item_id = document.getElementById("select_item_modi").value;
		var item_name = document.getElementById("modi_item_name").value;
		document.location = 'addItemLoading.do?mode=modify&item_id='+item_id+'&item_name='+item_name;
	}
	
	function add(){
		var item_name = document.getElementById("select_item_add").value;
		document.location = 'addItemLoading.do?mode=add&item_name='+item_name;
	}
</script>
</head>

<body data-spy="scroll" data-target=".bs-docs-sidebar">
	<!-- 메뉴
    ================================================== -->
	<%
		if (session.getAttribute("user") == null) {
	%>
	<jsp:include page="/top.do"></jsp:include>
	<%
		} else {
			Users u = (Users) session.getAttribute("user");
	%>
	<!-- 관리자가 로그인 했을 경우 메뉴 -->
	<jsp:include page="/managertop.do"></jsp:include>
	<%
		}
	%>
	<!-- 게시판
    ================================================== -->

	<div style="text-align: center">
		<div class="marketing"
			style="margin-bottom: 30px; color: #000; text-align: left">
			<div class="container">
				<h3 style="margin: 10px; font-size: 35px;">
					<strong>기자재 종류 관리</strong>
				</h3>
			</div>
		</div>
	</div>
	<div class="container">
		<div id="outerview">
			<div id="middleview">
				<div id="innerview">
					<div class="control-gruop">
						<form class="form-inline" method="post" style="text-align: left;">
							<div class="controls">
								<br>
								<table>
									<tr>
										<td class="title">삭제</td>
										<td>
										<select name="select_item" id="select_item_del">
												<c:forEach var="item" items="${item}">
													<option value="${item.item_id }">${item.item_name}</option>
												</c:forEach>
										</select>
											<button type="button" class="btn" onclick="del()">삭제</button>
											</td>
									</tr>
									<tr>
										<td>추가</td>
										<td><input type="text" class="input-middle" id="select_item_add">
											<button type="button" class="btn" onclick="add()">추가</button></td>
									</tr>
									<tr>
										<td>수정</td>
										<td>
											<select name="select_item" id="select_item_modi">
												<c:forEach var="item" items="${item}">
													<option value="${item.item_id}">${item.item_name}</option>
												</c:forEach>
											</select>
											<input type="text" class="input-middle" id="modi_item_name">
											<button type="button" class="btn" onclick="modify()">수정</button>
										</td>
									</tr>
								</table>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>



	<!-- 꼬리말
    ================================================== -->
	<footer class="footer">
		<div class="container">
			<p>Copyright SKHU. Software Student.</p>
		</div>
	</footer>


	<!-- javascript -->
	<script src="/LSsystem/assets/js/jquery.js"></script>
	<script type="text/javascript" src="/LSsystem/assets/js/bootstrap.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$('.dropdown-toggle').dropdown();
		});
	</script>
</body>
</html>
